﻿@model MvcMusicStore.Models.Album

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Album</legend>

        @Html.HiddenFor(model => model.AlbumId)
        <p>
            @Html.LabelFor(model => model.Genre) 
            @Html.DropDownList("GenreId",new SelectList(ViewBag.Genres as System.Collections.IEnumerable,
                                                "GenreId", "Name", Model.GenreId))
        </p>
        <p>
            @Html.LabelFor(model => model.Artist) 
            @Html.DropDownList("ArtistId",new SelectList(ViewBag.Artists as System.Collections.IEnumerable,
                                                "ArtistId", "Name", Model.ArtistId))
        </p>
        <p>
            @Html.LabelFor(model => model.Title) 
            @Html.TextBoxFor(model => model.Title) 
            @Html.ValidationMessageFor(model => model.Title)
        </p>
        <p>
            @Html.LabelFor(model => model.Price) 
            @Html.TextBoxFor(model => model.Price) 
            @Html.ValidationMessageFor(model => model.Price)
        </p>
        <p>
            @Html.LabelFor(model => model.AlbumArtUrl) 
            @Html.TextBoxFor(model => model.AlbumArtUrl)
            @Html.ValidationMessageFor(model => model.AlbumArtUrl)
        </p>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

